<div class="wide form">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'issue-form',
    'focus'=>array($model,'summary'),
    'enableAjaxValidation'=>false,
)); ?>

<p class="note"><?php echo Yii::t('site','Fields with {marker} are required.',array('{marker}'=>'<span class="required">*</span>')); ?></p>

    <?php echo $form->errorSummary($model); ?>

    <?php if(Yii::app()->getRequest()->getParam('Issue_page')) echo CHtml::hiddenField('Issue_page',Yii::app()->getRequest()->getParam('Issue_page')); ?>
    <div class="row">
        <?php echo $form->labelEx($model,'projectId'); ?>
        <?php echo $form->dropDownList($model,'projectId',Project::model()->selectOptions,array('empty'=>Yii::t('site','(Select)'))); ?>
        <?php echo $form->error($model,'projectId'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'summary'); ?>
        <?php echo $form->textField($model,'summary',array('size'=>60,'maxlength'=>255)); ?>
        <?php echo $form->error($model,'summary'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'description'); ?>
        <?php echo $form->textArea($model,'description',array('cols'=>50,'rows'=>6)); ?>
        <?php echo $form->error($model,'description'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'issueType'); ?>
        <?php echo $form->dropDownList($model,'issueType',$model->issueTypeOptions,array('empty'=>Yii::t('site','(Select)'))); ?>
        <?php echo $form->error($model,'issueType'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'issueStatus'); ?>
        <?php echo $form->dropDownList($model,'issueStatus',SWHelper::nextStatuslistData($model)); ?>
        <?php echo $form->error($model,'issueStatus'); ?>
    </div>

    <?php if(!$model->isNewRecord) : ?>
    <div class="row">
        <?php echo $form->labelEx($model,'ownerId'); ?>
        <?php echo $form->dropDownList($model,'ownerId',User::model()->selectOptions,array('empty'=>Yii::t('site','(Select)'))); ?>
        <?php echo $form->error($model,'ownerId'); ?>
    </div>
    <?php endif; ?>

    <div class="row">
        <?php echo $form->labelEx($model,'priority'); ?>
        <?php echo $form->dropDownList($model,'priority',$model->priorityOptions,array('empty'=>Yii::t('site','(Select)'))); ?>
        <?php echo $form->error($model,'priority'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'milestoneId'); ?>
        <?php echo $form->dropDownList($model,'milestoneId',Milestone::model()->selectOptions,array('empty'=>Yii::t('site','(Select)'))); ?>
        <?php echo $form->error($model,'milestoneId'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'tags'); ?>
        <?php echo $form->textArea($model,'tags',array('rows'=>6, 'cols'=>50)); ?>
        <?php echo $form->error($model,'tags'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'isChargeable'); ?>
        <?php echo $form->checkBox($model,'isChargeable'); ?>
        <?php echo $form->error($model,'isChargeable'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'hoursSpent'); ?>
        <?php echo $form->textField($model,'hoursSpent',array('size'=>6,'class'=>'centered')); ?>
        <?php echo $form->error($model,'hoursSpent'); ?>
    </div>

    <div class="row buttons">
        <?php $this->widget( 'application.extensions.button.DDButton',
			array(
				'title'=>$model->isNewRecord?Yii::t('site','Create'):Yii::t('site','Save'),
				'linkTitle'=>$model->isNewRecord?Yii::t('site','Create this record'):Yii::t('site','Save this record'),
				'formID' => 'issue-form',
				'buttonType' => 'save'
		)); ?>
        <?php $this->widget( 'application.extensions.button.DDButton',
			array(
				'title'=>Yii::t('site','Reset'),
				'linkTitle'=>Yii::t('site','Reset the form data'),
				'formID' => 'issue-form',
				'buttonType' => 'reset',
				'confirm' => Yii::t('site','Really reset this form?')
		)); ?>
        <?php $this->widget( 'application.extensions.button.DDButton',
			array(
				'title'=>Yii::t('site','Cancel'),
				'linkTitle'=>Yii::t('site','Cancel editing, back to list'),
				'formID' => 'issue-form',
				'buttonType' => 'cancel',
				'confirm' => Yii::t('site','Really cancel editing this item?'),
				'url' => array('issue/admin','Issue_page'=>$page)
		)); ?>
    </div>

<?php $this->endWidget(); ?>

</div><!-- form -->
